package com.chixing.day03;

/**
 * @author Y2014188432
 */
public class PersonTest {
    public static void main(String[] args) {
        Person person1 = new Person("张三",'男',25,false);
        Person person2 = new Person("李梅",'女',26,false);
        Person person3 = new Person("Jake",'男',25,false);
        Person person4 = new Person("Ben",'女',19,false);
        Person person5 = new Person("Joker",'男',29,true);
        System.out.println("========= test1 ==========");
        if(person1.can(person2)){
            System.out.println("能！");
        } else{
            System.out.println("不能!");
        }
        System.out.println("========= test2 (性别问题)==========");
        if (person1.can(person3)){
            System.out.println("能！");
        } else{
            System.out.println("不能!");
        }
        System.out.println("========= test3 (年龄问题)==========");
        if (person1.can(person4)){
            System.out.println("能！");
        } else{
            System.out.println("不能!");
        }
        System.out.println("========= test4 (一方已结婚)==========");
        if (person2.can(person5)){
            System.out.println("能！");
        } else{
            System.out.println("不能!");
        }
    }
}
